﻿using Microsoft.Office.Interop.Outlook;

namespace Citi.OTFPC.PP.ProcessDashboard.S.Console.Util
{
    public class EmailHelper
    {
        // Fields
        private Application oApp = new Microsoft.Office.Interop.Outlook.Application();
        private _NameSpace oNameSpace;
        private MAPIFolder oSentMail;

        // Methods
        public EmailHelper()
        {
            this.oNameSpace = this.oApp.GetNamespace("MAPI");
            this.oNameSpace.Logon(string.Empty, string.Empty, true, true);
            this.oSentMail = this.oNameSpace.GetDefaultFolder(OlDefaultFolders.olFolderSentMail);
        }

        public void SendMailToITTools(string toValue, string subjectValue, string bodyValue)
        {
            _MailItem item = (_MailItem)this.oApp.CreateItem(OlItemType.olMailItem);
            item.Importance = OlImportance.olImportanceHigh;
            item.To = toValue;
            item.BCC = "FC16291";
            item.BodyFormat = OlBodyFormat.olFormatHTML;
            item.Subject = subjectValue;
            item.Body = bodyValue;
            item.Send();
        }
    }



}
